import { Link, useNavigate } from 'react-router-dom'

const Login = () => {

  const navigate = useNavigate()

  return (
    <>
      <div>登录页面</div>
      {/* 声明式导航不能嵌入业务逻辑 */}
      <Link to="/article/1/zs?age=18">去文章详情页面</Link>

      {/* 编程式导航可以嵌入业务逻辑代码 */}
      <button onClick={() => navigate('/article/2/ls?age=28')}>登录</button>

    </>
  )
}

export default Login